public class Account {
    String accNo;
    String accName;
    double balance;

    public Account() {
        this.accNo = "000";
        this.accName = "未知";
        this.balance = 0.0;
    }

    public Account(String accNo, String accName) {
        this.accNo = accNo;
        this.accName = accName;
        this.balance = 0.0;
    }

    public Account(String accNo, String accName, double balance) {
        this.accNo = accNo;
        this.accName = accName;
        this.balance = balance;
    }

    public static void main(String[] args) {
        Account a = new Account();
        Account b = new Account("20060623", "changing");
        Account c = new Account("20230618", "yu", 10000);

        a.deposit(500);
        a.withdraw(100);
        a.printInfo();

        b.deposit(1000);
        b.withdraw(1000);
        b.printInfo();

        c.deposit(111500);
        c.withdraw(12200);
        c.printInfo();
    }

    public void deposit(double money) {
        this.balance += money;
        System.out.println("存钱成功，当前余额为" + this.balance);
    }

    public void withdraw(double money) {
        if (this.balance >= money) {
            this.balance -= money;
            System.out.println("取钱成功，当前余额为" + this.balance);
        } else {
            System.out.println("余额不足，请重新输入");
        }
    }

    public void printInfo() {
        System.out.println("账户：" + this.accNo + " 账户名：" + this.accName + " 余额" + this.balance);
    }
}
